﻿#ifndef SERVERMONITORCONTROLLER_H
#define SERVERMONITORCONTROLLER_H

#include <httpcontroller.h>
using namespace stefanfrings;

class ServerMonitorController : public HttpController
{
    Q_OBJECT
public:
    explicit ServerMonitorController(QObject *parent = nullptr);
    ~ServerMonitorController();
    void route(QString path, QString method, HttpRequest &request, HttpResponse &response) override;

private:
    void getAllInfo(HttpRequest &request, HttpResponse &response);
    void getServerInfo(HttpRequest &request, HttpResponse &response);
    void getCpuInfoList(HttpRequest &request, HttpResponse &response);
    void getMemoryInfoList(HttpRequest &request, HttpResponse &response);
    void getDiskInfoList(HttpRequest &request, HttpResponse &response);
    void getCupUseList(HttpRequest &request, HttpResponse &response);
    void getMemoryUseList(HttpRequest &request, HttpResponse &response);
    void getVirtualMemoryUseList(HttpRequest &request, HttpResponse &response);
    void getDiskUseList(HttpRequest &request, HttpResponse &response);
    void getNetworkInfoList(HttpRequest &request, HttpResponse &response);
    void getNetworkUseList(HttpRequest &request, HttpResponse &response);
};

#endif // SERVERMONITORCONTROLLER_H
